/**
 * hex转rgba
 * @param bgColor
 * @param alpha
 */
export const useHexToRgba = (bgColor, alpha = 0.2) => {
    const color = bgColor.slice(1); // 去掉'#'号
    const rgba = [
        parseInt("0x" + color.slice(0, 2)),
        parseInt("0x" + color.slice(2, 4)),
        parseInt("0x" + color.slice(4, 6)),
        alpha
    ];
    return `rgba(${rgba.toString()})`;
};